package com.example.config;

import com.example.demo.Student;
import com.example.impl.AsyncStudent;
import com.example.impl.StudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@Component("ServiceImpl")
public class ServiceImpl {
    @Autowired
    private StudentMapper studentMapper;

    @Autowired
    private AsyncStudent asyncStudent;

    public Student getStudent(){
        return studentMapper.selectById();
    }

    public Student insert() {
        asyncStudent.insert(new Student("1",3L));
        return new Student("2",4L);
    }

}
